import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

//1000 1141 0001 4978 306

class YFloorContent extends StatelessWidget {
  final List floorGoodsList;

  YFloorContent({Key key, this.floorGoodsList}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[_firstRow(), _otherGoods()],
    );
  }

  Widget _firstRow() {
    return Row(
      children: <Widget>[
        _goodsItem(floorGoodsList[0]),
        Column(
          children: <Widget>[
            _goodsItem(floorGoodsList[1]),
            _goodsItem(floorGoodsList[2])
          ],
        )
      ],
    );
  }

  Widget _otherGoods() {
    return Row(
      children: <Widget>[
        _goodsItem(floorGoodsList[3]),
        _goodsItem(floorGoodsList[4])
      ],
    );
  }

  /*图片布局*/
  Widget _goodsItem(Map goods) {
    return Container(
      width: ScreenUtil().setWidth(375),
      child: InkWell(
        onTap: () {
          print("点击了某种商品");
        },
        child: Image.network(goods['image']),
      ),
    );
  }
}
